#!/bin/bash
cd step5
make > /dev/null 2>&1
./main > res
read user < res
i=1
flag=1
array=(9 15 14 5 6 7)
while((i<7))
do
        split=`echo $user|cut -d " " -f$i`
	asc=`printf "%d\n" "'$split"` 
	t=15 # t=0xf
	s=$(($asc & $t))
	#echo "asc: $asc t:$t  s: $s ${array[$i-1]}"
	if [ ${array[$i-1]} != $s ]		
	then flag=0
	fi
    #echo "flag: $flag"
	((i++))
done

if [ $flag == 0 ]
 then printf "no"
 else printf "yes"
fi


minNotesLen=200;
awk -v minNotesLen=$minNotesLen '{
  if(flag==1 && $NF!~"\\*/" ){
      content=content""$0      
    }
if($0~/problem-solving ideas:/){
   flag=1; 
   content=content""substr($0,index($0,"ideas:")+6)
   startLine=FNR;
}
if($NF~"\\*/"&&flag==1){
   endLine=FNR;
   content=content""substr($0,1,index($0,"*/")-1)
   gsub(" ","",content)
   len=length(content)
   if(len<minNotesLen&&flag==1){
       #printf("notes len:%d,from line %d to line:%d\n",len,startLine,endLine);
       print("请在problem-solving ideas:后写下详细的解题思路！");
}
flag=0;
}
}' main.c   